package cn.edu.ptu.jobfairs.basic.common;

/**
 * Created by Lin Chenxiao on 2020-03-05
 **/
public enum Errors {
    CLIENT_ERROR(400, ""),
    INVALID_PARAMS(400, "传入参数不合法"),
    RECORD_EXISTS(400, "记录已存在"),
    RECORD_NOT_EXISTS(400, "记录不存在"),
    INVALID_REQUEST(400, "请求无效"),
    INVALID_PASSWORD(400, "密码错误"),
    NOT_LOGGED(401, ""),
    UNAUTHORIZED(403, "操作未授权"),
    SERVER_ERROR(500, ""),
    DATABASE_ERROR(503, "数据库出错");

    private int code;
    private String message;

    Errors(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
